#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/wait.h>


int main()
{
  
  printf("我的程序要运行了\n");
  if(fork()==0)
  {
    sleep(1);

   // execl("./other","other",NULL);
    //execl("/usr/bin/ls","ls","-l","-a",NULL);
  

   // execlp("ls","ls","-ln","-a",NULL);
   char *const argv[]=
   {
    (char*const)"other",
    (char*const)"-a",
    (char*const)"-b",
    (char*const)"-c",
    (char*const)"-d",
    NULL
   };
   

   char *const env[]=
   {
    (char *const)"MYVAL=123456789",
      NULL
   };
   execve("./other",argv,env);
  //execv("/usr/bin/ls",argv);
 // execvp(argv[0],argv);

    exit(1);
  }



  waitpid(-1,NULL,0);


  printf("我的程序运行完毕了\n");
  



  return 0;
}
